package com.shtel.paas.monitorcenter.system.management.user.management.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.shtel.paas.monitorcenter.system.management.user.management.entity.InsertEntity;
import com.shtel.paas.monitorcenter.system.management.user.management.entity.SearchEntity;
import com.shtel.paas.monitorcenter.system.management.user.management.entity.UpdateEntity;
import com.shtel.paas.monitorcenter.system.management.user.management.entity.deleteEntity;
import com.shtel.paas.monitorcenter.system.management.user.management.mapper.UserManagementMapper;
import com.shtel.paas.monitorcenter.system.management.user.management.service.UerManagementService;
import com.shtel.paas.monitorcenter.system.management.user.management.vo.MonitoringCenterUserVo;
import com.shtel.paas.monitorcenter.util.Page;

/**
 * 告警通知
 * 
 * @author zhaochuan.zhong
 *
 */

@Service
public class UerManagementImpl implements UerManagementService {

	@Autowired
	UserManagementMapper userManagementMapper;

	/**
	 * 用户信息列表数据获取
	 */
	@Override
	public Page<MonitoringCenterUserVo> selectUserInfo(SearchEntity rmpEnt) {

		PageHelper.startPage(rmpEnt.getPage(), rmpEnt.getSize());
		List<MonitoringCenterUserVo> selectUserInfo = this.userManagementMapper
				.selectUserInfo(rmpEnt);
		Page<MonitoringCenterUserVo> pageContent = Page.build(selectUserInfo);
		return pageContent;
	}

	/**
	 * 用户单个删除
	 */
	@Override
	public Integer deleteByIdsAndUserNo(deleteEntity rmpEnt) {
		Integer result = this.userManagementMapper.deleteByIdsAndUserNo(rmpEnt);
		return result;
	}

	/**
	 * 用户批量删除
	 */
	@Override
	public Integer deleteBatch(List<String> emp) {
		Integer result = this.userManagementMapper.deleteBatch(emp);
		return result;
	}

	/**
	 * 用户信息列表数据插入
	 */
	@Override
	public Integer insertUserInfo(InsertEntity rmpEnt) {
		Integer result = this.userManagementMapper.insertUserInfo(rmpEnt);
		return result;
	}

	/**
	 * 用户信息更新
	 */
	@Override
	public Integer updateUserInfo(UpdateEntity rmpEnt) {
		Integer result = this.userManagementMapper.updateUserInfo(rmpEnt);
		return result;
	}
}
